<template>
  <div>
    <h1>小头爸爸</h1>
    <big-header @addItem="addItem" @yangyang="yangyang"></big-header>
    <!-- <button @click="addItem({ name: 'lili', age: 10 })">
      添加大头儿子说出来的朋友
    </button> -->
  </div>
</template>

<script>
/* 
情景：
大头儿子和小头爸爸对话
大头儿子说出他的朋友
小头爸爸进行记录


大头儿子继续说他的朋友  子传父

小头爸爸接收到儿子的消息，将其添加到list当中
就是一个数组的添加动
this.list.push(item);


*/
import BigHeader from "./BigHeader";
export default {
  name: "",
  props: [""],
  data() {
    return {
      money: "100w",
      list: [
        { name: "tom", age: 18 },
        { name: "jack", age: 10 },
        { name: "rose", age: 15 },
      ],
    };
  },

  components: {
    BigHeader,
  },

  computed: {},

  beforeMount() {},

  mounted() {},

  methods: {
    addItem(item) {
      this.list.push(item);
      console.log(this.list);
    },
    yangyang(msg) {
      console.log("我是2203班第一帅！！");
      console.log(msg);
    },
  },

  watch: {},
};
</script>
<style lang='' scoped>
</style>